package com.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.entity.ProjectCategoryEntity;

@Repository
public class ProjectCategoryDaoImpl extends
		GenericDaoImpl<ProjectCategoryEntity> implements ProjectCategoryDao {

	public ProjectCategoryEntity getProjectCategoryById(int id) {
		return getById(ProjectCategoryEntity.class, id);
	}

	public ProjectCategoryEntity getProjectCategoryByUniqueId(String id) {
		Query query = sessionFactory.getCurrentSession().createQuery(
				"from ProjectCategoryEntity where id=:id");
		query.setParameter("id", id);
		return (ProjectCategoryEntity) query.uniqueResult();

	}

	public List<ProjectCategoryEntity> getAllProjectCategory() {
		return getAll(ProjectCategoryEntity.class);
	}

}
